// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "GameplayTagContainer.h"
#include "LyraAbilityCost.h"
#include "ScalableFloat.h"

#include "LyraAbilityCost_PlayerTagStack.generated.h"

struct FGameplayAbilityActivationInfo;
struct FGameplayAbilitySpecHandle;

class ULyraGameplayAbility;
class UObject;
struct FGameplayAbilityActorInfo;

/**
 * 表示一种需要消耗玩家状态上标签堆栈数量的成本
 */
UCLASS(meta=(DisplayName="Player Tag Stack"))
class ULyraAbilityCost_PlayerTagStack : public ULyraAbilityCost
{
	GENERATED_BODY()

public:
	ULyraAbilityCost_PlayerTagStack();

	//~ULyraAbilityCost interface
	/**
	 * 检查能力成本是否满足
	 * @param Ability 游戏能力对象
	 * @param Handle 能力规格句柄
	 * @param ActorInfo 演员信息
	 * @param OptionalRelevantTags 可选的相关标签容器
	 * @return 如果成本满足返回true，否则返回false
	 */
	virtual bool CheckCost(const ULyraGameplayAbility* Ability, const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, FGameplayTagContainer* OptionalRelevantTags) const override;
	
	/**
	 * 应用能力成本
	 * @param Ability 游戏能力对象
	 * @param Handle 能力规格句柄
	 * @param ActorInfo 演员信息
	 * @param ActivationInfo 能力激活信息
	 */
	virtual void ApplyCost(const ULyraGameplayAbility* Ability, const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo) override;
	//~End of ULyraAbilityCost interface

protected:
	/** 要消耗的标签数量（基于能力等级） */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Costs)
	FScalableFloat Quantity; // 可缩放浮点数，表示消耗数量

	/** 要消耗的标签 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Costs)
	FGameplayTag Tag; // 游戏标签，表示要消耗的标签类型
};